package com.example.demo.model;

import javax.persistence.*;

@Entity
@Table(name = "Ingredients")
public class Ingredients {
    @Id
    private String name;

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "energy")
    private Nutritionalvalue Nutritionalvalue;

    public Ingredients(String name, com.example.demo.model.Nutritionalvalue nutritionalvalue) {
        this.name = name;
        Nutritionalvalue = nutritionalvalue;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Nutritionalvalue getNutritionalValue() {
        return Nutritionalvalue;
    }

    public void setNutritionalvalue(com.example.demo.model.Nutritionalvalue nutritionalvalue) {
        Nutritionalvalue = nutritionalvalue;
    }
    @Override
    public String toString() {
        return Nutritionalvalue.toString();
    }
}
